package Leo.security;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.social.security.SocialUserDetails;
import org.springframework.stereotype.Component;

import java.util.Collection;
import java.util.Date;

public class UserDetailsImpl implements SocialUserDetails {

    private String username;
    private String password;
    private Date expiredDate;
    private String status;
    //social user details
    private String userId;


    public UserDetailsImpl(String username,String password){
        this.username = username;
        this.password = password;
    }

    public UserDetailsImpl(String username,String password,String userId){
        this.username = username;
        this.password = password;
        this.userId = userId;
    }
    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return null;
    }

    @Override
    public String getPassword() {
        return password;
    }

    @Override
    public String getUsername() {
        return username;
    }

    @Override
    public boolean isAccountNonExpired() {
        return false;
    }

    @Override
    public boolean isAccountNonLocked() {
        return false;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return false;
    }

    @Override
    public boolean isEnabled() {
        return false;
    }

    /**
     * The user's identity at the provider.
     * Might be same as {@link #getUsername()} if users are identified by username
     *
     * @return user's id used to assign connections
     */
    @Override
    public String getUserId() {
        return userId;
    }
}
